<?php
/**
 * Created by PhpStorm.
 * User: dreamy
 * Date: 2019-05-25
 * Time: 12:14
 */
namespace common\services;

/**
 * Class BaseService
 * @package common\services
 */
class BaseService
{
    /**
     * @var string
     * 错误信息
     */
    protected static $errMsg ;

    /**
     * @return string
     * 返回错误信息
     */
    public static function getError()
    {
        return self::$errMsg;
    }

    /**
     * @param $err
     * 设置错误
     */
    public static function setError($err)
    {
        self::$errMsg = $err ;
    }
    /**
     * desc:检测数据
     * admin
     * email:
     * @param array $params
     * @param string $field
     * @return bool
     */
    static function checkIsHasField($params = [],$field = ''){
        return isset($params[$field]) && $params[$field] !== '' && !is_null($params[$field]);
    }
}